﻿$(function(){//延迟加载
	var dvIds=$('#dvIds').val();
	var sectype=$('#sectype').val();
//	alert(sectype);
	if(dvIds!=''){
		document.getElementById('jxmap').src='creatjxmap?dvIds='+dvIds+'&sectype='+sectype;
	}
	$('#dajuxiang').combobox({
		onChange:function(newValue,oldValue){
			if(newValue=='0'){				
				$('#juxiang').combobox({					
					disabled:true
				});
				$('#juxiang').combobox('clear');
				$('#jifang').combobox({
					disabled:true
				});
				$('#jifang').combobox('clear');
			}else{
				$('#jifang').combobox({
					disabled:true
				});
				$('#juxiang').combobox({
					value:'请选择',
					disabled:false,
					valueField: 'jxId',    
			        textField: 'jxname',
					url:"showjx?djxId="+newValue,
				});
			}
		}
	});
	$('#jifang').combobox({
		width:200,
		onChange:function(newValue,oldValue){
			document.getElementById('jxmap').src="creatjxmap?jfId="+newValue;
		}
	});
	$('#juxiang').combobox({
		onChange:function(newValue,oldValue){
			if(newValue=='0'){				
				$('#jifang').combobox({
					disabled:true
				});
				$('#jifang').combobox('clear');
			}else{
				$('#jifang').combobox({
					value:'请选择',
					disabled:false,
					valueField:'jfId',
					textField:'jfname',
					url:'showjf?jxId='+newValue
				})
			}
			//$('#jxmap').src='creatjxmap?jxId='+newValue;
			if(newValue!='0')
			 document.getElementById('jxmap').src="creatjxmap?jxId="+newValue;
		}
	});	
});